<template>
  <input type="text" v-model="age">
</template>

<script lang="ts" setup>
import {ref, watch} from "vue";

const age=ref(18)
//监控函数
watch(age,(newValue,oldValue)=>{
  console.log(newValue,"->",oldValue)
})
</script>


<style>

</style>